/*
 * PhonesSingletonFactory.cpp
 *
 *  Created on: 03 Ιουν 2010
 *      Author: Sartios
 */

#include "PhonesSingletonFactory.h"

#include "../Phone/Phone.h"

PhonesSingletonFactory * PhonesSingletonFactory::instance_=NULL;

PhonesSingletonFactory * PhonesSingletonFactory::getInstance(){
	if(NULL==instance_){
		instance_=new PhonesSingletonFactory;
	}
	return instance_;
}

PhonesSingletonFactory::PhonesSingletonFactory(void){
	MOBILE = new string("mobile");
	HOME = new string("home");
	FAX =new string("fax");
}

PhonesSingletonFactory::~PhonesSingletonFactory(void){
	delete instance_;
	delete FAX;
	delete HOME;
	delete MOBILE;
}

IPhone	*	PhonesSingletonFactory::getPhone(const string *category){
	if(NULL!=category){
		if(category->compare(HOME->c_str())){
			return new Phone;
		}
	}
	return NULL;
}
